#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
/*
注意 1. 输出格式
    2. 需要长整形
    3. 注意负数
*/
ll GCD(ll num1, ll num2)
{
    if (num1 % num2 == 0)
        return num2;
    else
        return GCD(num2, num1 % num2);
}
ll LCM(ll a, ll b)
{
    ll temp_lcm;
    temp_lcm = a * b / GCD(a, b); // 最小公倍数等于两数之积除以最大公约数
    return temp_lcm;
}

int main()
{
    int n;
    cin >> n;
    set<ll> Set;
    set<ll>::iterator iter;
    vector<vector<ll> > vec;
    for (ll i = 1; i <= n; i++)
    {
        ll up, low;
        vector<ll> temp(2);
        scanf("%lld/%lld", &up, &low);
        temp[0] = up;
        temp[1] = low;
        Set.insert(low);
        vec.push_back(temp);
    }
    // find the least common multiple
    ll MIN = *Set.begin();
    for (iter = Set.begin(); iter != Set.end(); iter++)
    {
        MIN = LCM(MIN, *iter);
    }
    ll sum = 0; // 统计分子的值
    for (auto &v : vec)
    {
        sum += MIN / v[1] * v[0];
    }
    ll t = GCD(fabs(sum), MIN); //对结果进项化简
    sum /= t;
    MIN /= t;

    if (sum % MIN == 0)
    {
        cout << sum / MIN << endl;
    }
    else if (sum > MIN)
    {
        cout << sum / MIN << ' ' << sum % MIN << '/' << MIN << endl;
    }
    else
    {
        cout << sum % MIN << '/' << MIN << endl;
    }
    return 0;
}